package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DdOrderInfoMapper;
import com.ruoyi.system.domain.DdOrderInfo;
import com.ruoyi.system.service.IDdOrderInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 进行中订单Service业务层处理
 * 
 * @author Abeiv
 * @date 2020-03-20
 */
@Service
public class DdOrderInfoServiceImpl implements IDdOrderInfoService 
{
    @Autowired
    private DdOrderInfoMapper ddOrderInfoMapper;

    /**
     * 查询进行中订单
     * 
     * @param id 进行中订单ID
     * @return 进行中订单
     */
    @Override
    public DdOrderInfo selectDdOrderInfoById(Long id)
    {
        return ddOrderInfoMapper.selectDdOrderInfoById(id);
    }

    /**
     * 查询进行中订单列表
     * 
     * @param ddOrderInfo 进行中订单
     * @return 进行中订单
     */
    @Override
    public List<DdOrderInfo> selectDdOrderInfoList(DdOrderInfo ddOrderInfo)
    {
        return ddOrderInfoMapper.selectDdOrderInfoList(ddOrderInfo);
    }

    /**
     * 新增进行中订单
     * 
     * @param ddOrderInfo 进行中订单
     * @return 结果
     */
    @Override
    public int insertDdOrderInfo(DdOrderInfo ddOrderInfo)
    {
        ddOrderInfo.setCreateTime(DateUtils.getNowDate());
        return ddOrderInfoMapper.insertDdOrderInfo(ddOrderInfo);
    }

    /**
     * 修改进行中订单
     * 
     * @param ddOrderInfo 进行中订单
     * @return 结果
     */
    @Override
    public int updateDdOrderInfo(DdOrderInfo ddOrderInfo)
    {
        return ddOrderInfoMapper.updateDdOrderInfo(ddOrderInfo);
    }

    /**
     * 删除进行中订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDdOrderInfoByIds(String ids)
    {
        return ddOrderInfoMapper.deleteDdOrderInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除进行中订单信息
     * 
     * @param id 进行中订单ID
     * @return 结果
     */
    @Override
    public int deleteDdOrderInfoById(Long id)
    {
        return ddOrderInfoMapper.deleteDdOrderInfoById(id);
    }
}
